<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
</head>
<body style="padding:10px;">
  <div class="tplay-body-div">
    <div class="layui-tab">
      <ul class="layui-tab-title">
        <li><a href="{:url('admin/employ/index')}" class="a_menu">招聘管理</a></li>
        <li class="layui-this">添加招聘</li>
      </ul>
    </div> 
    <div style="margin-top: 20px;">
    </div>
    <form class="layui-form" id="admin">
      <input type="hidden" name="id" value="{$employ.id??''}" >
      
      <div class="layui-form-item">
        <label class="layui-form-label">职位</label>
        <div class="layui-input-block" style="max-width:600px;">
          <input name="name" lay-verify="name" autocomplete="off" placeholder="请输入职位" class="layui-input" type="text" value="{$employ.name??''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">工作地点</label>
        <div class="layui-input-block" style="max-width:600px;">
          <input name="location" lay-verify="location" autocomplete="off" placeholder="请输入工作地点" class="layui-input" type="text" value="{$employ.location??''}">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">岗位要求</label>
        <div class="layui-input-block" style="max-width:1000px;">
          <textarea placeholder="请输入内容" class="layui-textarea" name="yaoqiu" id="container1" style="border:0;padding:0">{notempty name="$employ.yaoqiu"}{$employ.yaoqiu}{/notempty}</textarea>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">岗位职责</label>
        <div class="layui-input-block" style="max-width:1000px;">
          <textarea placeholder="请输入内容" class="layui-textarea" name="zhize" id="container2" style="border:0;padding:0">{notempty name="$employ.zhize"}{$employ.zhize}{/notempty}</textarea>
        </div>
      </div>
      
    <label class="layui-form-label">招聘状态</label>
    <div class="layui-input-block">
      <input type="radio" name="state" value="0" title="正在招聘" {notempty name="$employ.state"}{if $employ.state=='1'}checked{/if}{/notempty}  {empty name="$employ.state"} checked{/empty}>
      <input type="radio" name="state" value="1" title="招聘停止"  {notempty name="$employ.state"}{if $employ.state=='1'} checked {/if}{/notempty}>
    </div>
  </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
      
    </form>


    <script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    
    <script>
      layui.use(['layer', 'form'], function() {
          var layer = layui.layer,
              $ = layui.jquery,
              form = layui.form;
          $(window).on('load', function() {
              form.on('submit(admin)', function(data) {
                  $.ajax({
                      url:"{:url('admin/employ/add')}",
                      data:$('#admin').serialize(),
                      type:'post',
                      async: false,
                      success:function(res) {
                          if(res.code == 1) {
                              layer.alert(res.msg, function(index){
                                location.href = res.url;
                              })
                          } else {
                              layer.msg(res.msg);
                          }
                      }
                  })
                  return false;
              });
          });
      });
    </script>
 <script id="container1" name="yaoqiu" type="text/plain">
        这里写你的初始化内容
    </script>
     <script id="container2" name="zhize" type="text/plain">
        这里写你的初始化内容
    </script>
    <!-- 配置文件 -->
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container1');
    </script>
    <script type="text/javascript">
        var ue = UE.getEditor('container2');
    </script>
   
  </div>
</body>
</html>